using System;
using System.Collections;
using System.Xml.Serialization;

namespace com.exceptionalsoftware.spacetime.KML
{
    public class LinearRingList
    {
        private ArrayList ringList;

        public LinearRingList()
        {
            this.ringList = new ArrayList();
        }

        public LinearRingList(Geometry[] rings)
        {
            this.ringList = new ArrayList(rings);
        }

        [XmlIgnore()]
        public int Count
        {
            get { return this.ringList.Count; }
        }

        [XmlIgnore()]
        public Geometry this[int index]
        {
            get { return (Geometry)this.ringList[index]; }
        }

        public void Clear()
        {
            this.ringList.Clear();
        }

        public void Add(LinearRing ring)
        {
            this.ringList.Add(ring);
        }

        public void Remove(LinearRing ring)
        {
            this.ringList.Remove(ring);
        }

        public LinearRing[] ToArray()
        {
            return (LinearRing[])this.ringList.ToArray(typeof(LinearRing));
        }
    }

}